<?php

namespace addons\TinyShare\merchant\controllers;

use Yii;
use common\traits\MerchantCurd;
use addons\TinyShare\common\models\ShareAdv;

class ShareAdvController extends BaseController
{
	use MerchantCurd;
	
	public $modelClass = ShareAdv::class;
	
	/**
     * 编辑/创建
     *
     * @return mixed
     */
    public function actionEdit()
    {
        $request = Yii::$app->request;
        $id = $request->get('id', null);
        $model = $this->findModel($id);
        if ($model->load($request->post()) && $model->save()) {
            return $this->redirect(['index']);
        }

        return $this->render($this->action->id, [
            'model' => $model,
            'locals' => ShareAdv::$localExplain,
        ]);
    }

}
